package sqlutil.criteriaImpl;

import java.util.ArrayList;
import java.util.List;


import sqlutil.Criteria;
import sqlutil.SqlQuery;

public class CriteriaLike implements Criteria{
	
	private String propertyName ;
	private Object val ;
	private List<Object> vals = new ArrayList<Object>();
	
	public CriteriaLike(String propertyName, Object val){
		this.propertyName = propertyName;
		this.val = val;
		vals.add(val);
	}
	
	@Override
	public String toSqlString( SqlQuery sq ) {
		
		return " "+propertyName+" like ? ";
	}

	@Override
	public List<Object> getParamObjs() {
		return vals;
	}

	@Override
	public String getPropertyName(){
		return propertyName;
	}
}
